home *** CD-ROM | disk | FTP | other *** search
/ PC Basics 53 / PC Basics Issue 53.iso / Software / Internet / Invboard.exe / PC Basics 53 / Invboard / upload / sm_install.php < prev    next >
Encoding:
PHP Script  |  2002-06-07  |  67.0 KB  |  1,514 lines

  1. <?php
  2.  
  3.  
  4. /*
  5. +--------------------------------------------------------------------------
  6. |   IBFORUMS SAFE MODE INSTALL SCRIPT v0.1
  7. |   ========================================
  8. |   by Matthew Mecham and David Baxter
  9. |   (c) 2001, 2002 IBForums
  10. |   http://www.ibforums.com
  11. |   ========================================
  12. |   Web: http://www.ibforums.com
  13. |   Email: phpboards@ibforums.com
  14. |   Licence Info: phpib-licence@ibforums.com
  15. +---------------------------------------------------------------------------
  16. |
  17. |   > Script written by Matthew Mecham
  18. |   > Date started: 30th March 2002
  19. |
  20. +--------------------------------------------------------------------------
  21. */
  22.  
  23. error_reporting  (E_ERROR | E_WARNING | E_PARSE);
  24. set_magic_quotes_runtime(0);
  25.  
  26. //+---------------------------------------
  27. // ENTER YOUR PATH TO THE DIRECTORY THIS SCRIPT
  28. // IS IN.
  29. //
  30. // Tips:
  31. //
  32. // If you are using Windows and Apache, do not
  33. // use backslashes, use normal forward slashes.
  34. // You may need to remove the drive letter also
  35. // Example: C:\apache\htdocs\ibforums\ will need
  36. // to be: /apache/htdocs/ibforums/
  37. //
  38. // If you are using Windows and IIS, then you will 
  39. // need to enter double backslashes.
  40. //
  41. // In all cases, please enter a trailing slash (or
  42. // trailing backslashes...)
  43. //+---------------------------------------
  44.  
  45. $root = "./";
  46.  
  47.  
  48.  
  49. //+---------------------------------------
  50.  
  51. $template = new template;
  52. $std      = new installer;
  53.  
  54. $VARS = $std->parse_incoming();
  55.  
  56. //+---------------------------------------
  57. // What are we doing then? Eh? I'm talking to you!
  58. //+---------------------------------------
  59.  
  60. if ( file_exists($root.'install.lock') )
  61. {
  62.     install_error("This installer is locked!<br>Please (via FTP) remove the 'install.lock' file in this directory");
  63.     exit();
  64. }
  65.  
  66.  
  67. switch($VARS['a'])
  68. {
  69.     case '1':
  70.         do_setup_form();
  71.         break;
  72.         
  73.     case '2':
  74.         do_install();
  75.         break;
  76.         
  77.     case '3':
  78.         do_finish();
  79.         break;
  80.         
  81.     default:
  82.         do_intro();
  83.         break;
  84. }
  85.  
  86. function do_finish()
  87. {
  88.     global $std, $template, $root, $VARS, $SQL;
  89.     
  90.     // Attempt to lock the install..
  91.     
  92.     if ($FH = fopen( $root.'install.lock', 'w' ) )
  93.     {
  94.         fwrite( $FH, 'bleh', 4 );
  95.         fclose($FH);
  96.         
  97.         @chmod( $root.'install.lock', 0666 );
  98.         
  99.         $template->print_top('Success!');
  100.     
  101.         $template->contents .= "<tr>
  102.                                   <td id='subtitle'>• Success!</td>
  103.                                 <tr>
  104.                                 <td>
  105.                                   <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  106.                                   <tr>
  107.                                     <td>
  108.                                   <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  109.                                    <tr>
  110.                                     <td>
  111.                                      <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  112.                                      <tr>
  113.                                        <td>
  114.                                             <b>The installation is now complete!</b>
  115.                                             <br><br>
  116.                                             Although the installer is now locked (to re-install, remove the file 'install.lock'), for added
  117.                                             security, please remove the sm_install.php program before continuing.
  118.                                             <br><br>
  119.                                             <center><b><a href='index.php?act=Login&CODE=00'>CLICK HERE TO LOG IN!</a></center>
  120.                                         </td>
  121.                                      </tr>
  122.                                     </table>
  123.                                   </td>
  124.                                  </tr>
  125.                                 </table>
  126.                                </td>
  127.                               </tr>
  128.                              </table>";
  129.     }
  130.     else
  131.     {
  132.     $template->print_top('Success!');
  133.  
  134.     $template->contents .= "<tr>
  135.                               <td id='warning'>• WARNING!</td>
  136.                             <tr>
  137.                             <td>
  138.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  139.                               <tr>
  140.                                 <td>
  141.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  142.                                <tr>
  143.                                 <td>
  144.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  145.                                  <tr>
  146.                                    <td>
  147.                                         <b>The installation is now complete!</b>
  148.                                         <br><br>
  149.                                         PLEASE REMOVE THE INSTALLER ('sm_install.php') BEFORE CONTINUING!
  150.                                         <br>
  151.                                         Failure to do so will enable ANYONE to delete your board at any time!
  152.                                         <br><br>
  153.                                         <center><b><a href='index.php?act=Login&CODE=00'>CLICK HERE TO LOG IN!</a></center>
  154.                                     </td>
  155.                                  </tr>
  156.                                 </table>
  157.                               </td>
  158.                              </tr>
  159.                             </table>
  160.                            </td>
  161.                           </tr>
  162.                          </table>";
  163.     }
  164.                          
  165.     $template->output();
  166.     
  167.     
  168.     
  169. }
  170.  
  171. //+---------------------------------------
  172.  
  173.  
  174. function do_install()
  175. {
  176.     global $std, $template, $root, $VARS, $HTTP_POST_VARS;
  177.     
  178.     // Ok, lets check for blankies...
  179.     
  180.     $NEW_INFO = array();
  181.     
  182.     $need = array('board_url','sql_host','sql_database','sql_user','adminname','adminpassword','adminpassword2','email');
  183.     
  184.     //-----------------------------------
  185.     
  186.     foreach($need as $greed)
  187.     {
  188.         if ($VARS[ $greed ] == "")
  189.         {
  190.             install_error("You must complete all of the form with the sole exception of 'SQL Table prefix'");
  191.         }
  192.     }
  193.     
  194.     //-----------------------------------
  195.     
  196.     $VARS['board_url'] = preg_replace( "#/$#", "", $VARS['board_url'] );
  197.     
  198.     if ($VARS['sql_tbl_prefix'] == "")
  199.     {
  200.         $VARS['sql_tbl_prefix'] = 'ibf_';
  201.     }
  202.     
  203.     //-----------------------------------
  204.     // Did the admin passy and passy2 match?
  205.     //-----------------------------------
  206.     
  207.     if ($VARS['adminpassword2'] != $VARS['adminpassword'])
  208.     {
  209.         install_error("Your passwords did not match");
  210.     }
  211.     
  212.     /*if ( ! preg_match( "!^http://!", $VARS['board_url'] ) )
  213.     {
  214.         install_error("The board URL must start with 'http://'");
  215.     }*/
  216.     
  217.     //-----------------------------------
  218.     // IMPORT $INFO!
  219.     //-----------------------------------
  220.     
  221.     if ($root == './')
  222.     {
  223.         $root = str_replace( '\\', '/', getcwd() ) . '/';
  224.     }
  225.     
  226.     $require = $root."conf_global.php";
  227.     
  228.     if ( ! file_exists($require) )
  229.     {
  230.         install_error("Could not locate '$require'. You may need to enter a value for the root path in this installer script, to do this, simply open up this script in a text editor and enter a value in \$root - remember to add a trailing slash. NT users will need to use double backslashes");
  231.     }
  232.     
  233.     //@chmod( "conf_global.php", 0666 );
  234.     
  235.     include($require);
  236.     
  237.     //echo("here");
  238.     //exit();
  239.     
  240.     if ( count($INFO) < 1 )
  241.     {
  242.         install_error("Possible corruption in 'conf_global.php' ({$VARS['base_dir']}conf_global.php), please re-upload in ASCII format");
  243.     }
  244.     
  245.     //-----------------------------------
  246.     // Attempt a DB connection..
  247.     //-----------------------------------
  248.     
  249.     if ( ! $connect_id = mysql_connect( $VARS['sql_host'],$HTTP_POST_VARS['sql_user'],$HTTP_POST_VARS['sql_pass'] ) )
  250.     {
  251.         install_error("Could not create a mySQL connection, please check the SQL values entered");
  252.     }
  253.     
  254.         
  255.     if ( ! mysql_select_db($VARS['sql_database'], $connect_id) )
  256.     {
  257.         install_error("mySQL could not locate a database called '{$VARS['sql_database']}' please check the value entered for this");
  258.     }
  259.     
  260.     //-----------------------------------
  261.     // Attempt to write the config file.
  262.     //-----------------------------------
  263.     
  264.     $new  = array( 'base_dir'       => $root,
  265.                    'board_url'      => $VARS['board_url'],
  266.                    'sql_host'       => $VARS['sql_host'],
  267.                    'sql_database'   => $VARS['sql_database'],
  268.                    'sql_user'       => $HTTP_POST_VARS['sql_user'],
  269.                    'sql_pass'       => $HTTP_POST_VARS['sql_pass'],
  270.                    'sql_tbl_prefix' => $VARS['sql_tbl_prefix'],
  271.                    
  272.                    'html_dir'       => $root."html/",
  273.                    'html_url'       => $VARS['board_url']."/html",
  274.                    'upload_dir'     => $root."uploads",
  275.                    'upload_url'     => $VARS['board_url']."/uploads",
  276.                    'email_in'       => $VARS['email'],
  277.                    'email_out'      => $VARS['email'],
  278.                    'ban_names'      => "",
  279.                    'ban_email'      => "",
  280.                    'ban_ip'         => "",
  281.                    'force_login'    => 0,
  282.                    'load_limit'     => "",
  283.                    'board_start'    => time(),
  284.                    'installed'      => 1,
  285.                    'guests_ava'     => 1,
  286.                    'guests_img'        => 1,
  287.                    'guests_sig'        => 1,
  288.                    'print_headers'  => 0,
  289.                    'guest_name_pre' => "Guest_",
  290.                  );
  291.                      
  292.      foreach( $new as $k => $v )
  293.      {
  294.          // Update the old...
  295.          
  296.          $v = preg_replace( "/'/", "\\'" , $v );
  297.          $v = preg_replace( "/\r/", ""   , $v );
  298.          
  299.          $INFO[ $k ] = $v;
  300.      }
  301.      
  302.      $file_string = "<?php\n";
  303.         
  304.      foreach( $INFO as $k => $v )
  305.      {
  306.          if ($k == 'skin' or $k == 'languages')
  307.          {
  308.             continue;
  309.          }
  310.          $file_string .= '$INFO['."'".$k."'".']'."\t\t\t=\t'".$v."';\n";
  311.      }
  312.      
  313.      $file_string .= "\n".'?'.'>';   // Question mark + greater than together break syntax hi-lighting in BBEdit 6 :p
  314.      
  315.      if ( $fh = fopen( $require, 'w' ) )
  316.      {
  317.          fputs($fh, $file_string, strlen($file_string) );
  318.          fclose($fh);
  319.      }
  320.      else
  321.      {
  322.          install_error("Could not write to 'conf_global.php'");
  323.      }
  324.      
  325.      //-----------------------------------
  326.      // Lets populate the database!
  327.      //-----------------------------------
  328.      
  329.      $SQL = get_sql();
  330.      
  331.      foreach( $SQL as $q )
  332.      {
  333.          if ($VARS['sql_tbl_prefix'] != "ibf_")
  334.         {
  335.            $q = preg_replace("/ibf_(\S+?)([\s\.,]|$)/", $VARS['sql_tbl_prefix']."\\1\\2", $q);
  336.         }
  337.         
  338.         if ( preg_match("/CREATE TABLE (\S+) \(/", $q, $match) )
  339.         {
  340.             if ($match[1])
  341.             {
  342.                 $the_query = "DROP TABLE if exists ".$match[1];
  343.                 if (! mysql_query($the_query, $connect_id) )
  344.                 {
  345.                     install_error("mySQL Error: ".mysql_error());
  346.                 }
  347.             }
  348.         }
  349.             
  350.         if ( ! mysql_query($q, $connect_id) )
  351.         {
  352.             install_error("mySQL Error: ".mysql_error());
  353.         }
  354.     }
  355.     
  356.     // Insert the admin...
  357.     
  358.     $passy = md5($VARS['adminpassword']);
  359.     $time  = time();
  360.     
  361.     $query = "INSERT INTO ".$VARS['sql_tbl_prefix']."members (id, name, mgroup, password, email, joined, ip_address, posts, title, last_visit, last_activity) ".
  362.              "VALUES(1, '{$VARS['adminname']}', 4, '$passy', '{$VARS['email']}', '$time', '127.0.0.1', '0', 'Administrator', '$time', '$time')";
  363.              
  364.     if ( ! mysql_query($query, $connect_id) )
  365.     {
  366.         install_error("mySQL Error: ".mysql_error());
  367.         
  368.     }
  369.     
  370.     // ARE WE DONE? REALLY? COOL!!
  371.     
  372.     $template->print_top('Success!');
  373.     
  374.     $template->contents .= "<tr>
  375.                               <td id='subtitle'>• Success!</td>
  376.                             <tr>
  377.                             <td>
  378.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  379.                               <tr>
  380.                                 <td>
  381.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  382.                                <tr>
  383.                                 <td>
  384.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  385.                                  <tr>
  386.                                    <td>
  387.                                            <b>Your board has now been installed!</b>
  388.                                            <br><br>
  389.                                            The installation process is almost complete..
  390.                                            <br><br>
  391.                                            <center><b><a href='sm_install.php?a=3'>CLICK HERE TO COMPLETE THE INSTALL</a></center>
  392.                                        </td>
  393.                                  </tr>
  394.                                 </table>
  395.                               </td>
  396.                              </tr>
  397.                             </table>
  398.                            </td>
  399.                           </tr>
  400.                          </table>";
  401.                          
  402.     $template->output();
  403.     
  404. }
  405.  
  406.  
  407.  
  408.  
  409. function do_setup_form()
  410. {
  411.     global $std, $template, $root, $HTTP_SERVER_VARS;
  412.     
  413.     $template->print_top('Set Up form');
  414.     
  415.     //--------------------------------------------------
  416.     
  417.     $this_url = str_replace( "/sm_install.php", "", $HTTP_SERVER_VARS['HTTP_REFERER']);
  418.     
  419.     if ( ! $this_url )
  420.     {
  421.         $this_url = substr($HTTP_SERVER_VARS['SCRIPT_NAME'],0, -15);
  422.         
  423.         if ($this_url == '')
  424.         {
  425.             $this_url == '/';
  426.         }
  427.         $this_url = 'http://'.$HTTP_SERVER_VARS['SERVER_NAME'].$this_url; 
  428.     } 
  429.     
  430.     
  431.     //--------------------------------------------------
  432.     
  433.     $template->contents .= "<tr>
  434.                               <td id='subtitle'>• Your Server Environment</td>
  435.                             <tr>
  436.                             <td>
  437.                               <form action='sm_install.php' method='POST'>
  438.                               <input type='hidden' name='a' value='2'>
  439.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  440.                               <tr>
  441.                                 <td>
  442.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  443.                                <tr>
  444.                                 <td>
  445.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  446.                                  <tr>
  447.                                    <td colspan='2' id='tdrow1'>
  448.                                            This section requires you to enter the paths and URL's for the board. If in doubt, please
  449.                                            check with your webhost before asking for support.
  450.                                        </td>
  451.                                  </tr>
  452.                                  
  453.                                  <tr>
  454.                                    <td width='40%' id='tdrow1'><b>The script URL</b><br>This is the URL (must start with http://) to the directory that this script is in</td>
  455.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='board_url' value='$this_url'></td>
  456.                                  </tr>
  457.                                  
  458.                                 </table>
  459.                               </td>
  460.                              </tr>
  461.                             </table>
  462.                            </td>
  463.                           </tr>
  464.                          </table>
  465.                          
  466.                          </td>
  467.                          </tr>
  468.                          <tr>
  469.                               <td id='subtitle'>• Your SQL Environment</td>
  470.                             <tr>
  471.                             <td>
  472.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  473.                               <tr>
  474.                                 <td>
  475.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  476.                                <tr>
  477.                                 <td>
  478.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  479.                                  <tr>
  480.                                    <td colspan='2' id='tdrow1'>
  481.                                            This section requires you to enter your SQL information. If in doubt, please
  482.                                            check with your webhost before asking for support. You may choose to enter an existing database name,
  483.                                            if not - you must create a new database before continuing.
  484.                                        </td>
  485.                                  </tr>
  486.                                  
  487.                                  <tr>
  488.                                    <td width='40%' id='tdrow1'><b>SQL Host</b><br>(localhost is usually sufficient)</td>
  489.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='sql_host' value='localhost'></td>
  490.                                  </tr>
  491.                                  
  492.                                  <tr>
  493.                                    <td width='40%' id='tdrow1'><b>SQL Database Name</b></td>
  494.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='sql_database' value=''></td>
  495.                                  </tr>
  496.                                  
  497.                                  <tr>
  498.                                    <td width='40%' id='tdrow1'><b>SQL Username</b></td>
  499.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='sql_user' value=''></td>
  500.                                  </tr>
  501.                                  
  502.                                  <tr>
  503.                                    <td width='40%' id='tdrow1'><b>SQL Password</b></td>
  504.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='sql_pass' value=''></td>
  505.                                  </tr>
  506.                                  
  507.                                  <tr>
  508.                                    <td width='40%' id='tdrow1'><b>SQL Table Prefix</b>(You can leave this blank)</td>
  509.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='sql_tbl_prefix' value=''></td>
  510.                                  </tr>
  511.                                  
  512.                                 </table>
  513.                               </td>
  514.                              </tr>
  515.                             </table>
  516.                            </td>
  517.                           </tr>
  518.                          </table>
  519.                          
  520.                          <tr>
  521.                               <td id='subtitle'>• Your Admin Account</td>
  522.                             <tr>
  523.                             <td>
  524.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  525.                               <tr>
  526.                                 <td>
  527.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  528.                                <tr>
  529.                                 <td>
  530.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  531.                                  <tr>
  532.                                    <td colspan='2' id='tdrow1'>
  533.                                            This section requires information to create your administration account. Please
  534.                                            enter the data carefully!
  535.                                        </td>
  536.                                  </tr>
  537.                                  
  538.                                  <tr>
  539.                                    <td width='40%' id='tdrow1'><b>Username</b></td>
  540.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='adminname' value=''></td>
  541.                                  </tr>
  542.                                  
  543.                                  <tr>
  544.                                    <td width='40%' id='tdrow1'><b>Password</b></td>
  545.                                    <td width='60%' id='tdrow2'><input type='password' id='textinput' name='adminpassword' value=''></td>
  546.                                  </tr>
  547.                                  
  548.                                  <tr>
  549.                                    <td width='40%' id='tdrow1'><b>Retype your password</b></td>
  550.                                    <td width='60%' id='tdrow2'><input type='password' id='textinput' name='adminpassword2' value=''></td>
  551.                                  </tr>
  552.                                  
  553.                                  <tr>
  554.                                    <td width='40%' id='tdrow1'><b>Email Address</b></td>
  555.                                    <td width='60%' id='tdrow2'><input type='text' id='textinput' name='email' value=''></td>
  556.                                  </tr>
  557.                                  
  558.                                  <tr>
  559.                                      <td colspan='2' id='tdrow1' align='center'><input type='submit' value='Process'></td>
  560.                                  </tr>
  561.                                 </table>
  562.                               </td>
  563.                              </tr>
  564.                             </table>
  565.                            </td>
  566.                           </tr>
  567.                          </table>
  568.                          </form>
  569.                          </td>
  570.                          </tr>
  571.                          
  572.                          ";
  573.                          
  574.     $template->output();
  575.                          
  576. }
  577.  
  578. //+---------------------------------------
  579.  
  580. function do_intro()
  581. {
  582.     global $std, $template, $root;
  583.     
  584.     $template->print_top('Welcome');
  585.     
  586.     $template->contents .= "<tr>
  587.                               <td id='subtitle'>• Welcome!</td>
  588.                             <tr>
  589.                             <td>
  590.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  591.                               <tr>
  592.                                 <td>
  593.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  594.                                <tr>
  595.                                 <td>
  596.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  597.                                  <tr>
  598.                                    <td>
  599.                                            <b>Welcome to the Invision Board Safe Mode Installer</b>
  600.                                            <br><br>
  601.                                            Before we go any further, please ensure that all the files have been uploaded, and that the 
  602.                                            file 'conf_global.php' has suitable permissions to allow this script to write to it ( 0666 should be sufficient ).
  603.                                            <br><br>
  604.                                            You will also need your SQL database name, your SQL username, your SQL password and SQL host (usually localhost).
  605.                                            <br><br>
  606.                                            Once you have clicked on proceed, you will be taken to a form to enter information the installer needs to set up your board.
  607.                                            <br><br>
  608.                                            <b>PLEASE NOTE: USING THIS INSTALLER WILL DELETE ANY CURRENT INVISION BOARD DATABASE IF YOU ARE USING THE SAME TABLE PREFIX</b>
  609.                                        </td>
  610.                                  </tr>
  611.                                 </table>
  612.                               </td>
  613.                              </tr>
  614.                             </table>
  615.                            </td>
  616.                           </tr>
  617.                          </table>";
  618.                          
  619.     // Check to make sure that the config file is there and it's got suitable permissions to write to:
  620.     
  621.     $file = $root."conf_global.php";
  622.     
  623.     $warnings = array();
  624.     
  625.     if ( ! file_exists($file) )
  626.     {
  627.         $warnings[] = "Cannot locate the file 'conf_global.php'. This should be uploaded into the same directory as this script!";
  628.     }
  629.     
  630.     if ( ! is_writeable($file) )
  631.     {
  632.         $warnings[] = "Cannot write to 'conf_global.php'. Please adjust the permissions to allow this script to write to the file. if in doubt, CHMOD via FTP to 0777";
  633.     }
  634.     
  635.     $phpversion = phpversion();
  636.     
  637.     if ($phpversion < '4.0.0') {
  638.         $warnings[] = "You cannot install Invision Board. Invision Board requires PHP Version 4.0.0 or better.";
  639.     }
  640.     
  641.     if ( count($warnings) > 0 )
  642.     {
  643.     
  644.         $err_string = "<ul><li>".implode( "<li>", $warnings )."</ul>";
  645.     
  646.         $template->contents .= "<tr>
  647.                               <td id='warning'>• WARNING!</td>
  648.                             <tr>
  649.                             <td>
  650.                               <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  651.                               <tr>
  652.                                 <td>
  653.                               <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  654.                                <tr>
  655.                                 <td>
  656.                                  <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  657.                                  <tr>
  658.                                    <td>
  659.                                            <b>The following errors must be rectified before continuing!</b>
  660.                                            <br><br>
  661.                                            $err_string
  662.                                        </td>
  663.                                  </tr>
  664.                                 </table>
  665.                               </td>
  666.                              </tr>
  667.                             </table>
  668.                            </td>
  669.                           </tr>
  670.                          </table>";
  671.     }
  672.     else
  673.     {
  674.         $template->contents .= "<tr><td align='center' style='font-size:18px'><br><b><a href='sm_install.php?a=1'>Proceed</a> >></b></td></tr>";
  675.     }
  676.     
  677.     
  678.     $template->output();
  679. }
  680.  
  681.  
  682.  
  683. function install_error($msg="")
  684. {
  685.     global $std, $template, $root;
  686.     
  687.     $template->print_top('Warning!');
  688.     
  689.  
  690.     
  691.     $template->contents .= "<tr>
  692.                           <td id='warning'>• WARNING!</td>
  693.                         <tr>
  694.                         <td>
  695.                           <table cellpadding='8' cellspacing='0' width='100%' align='center' border='0' id='tablewrap'>
  696.                           <tr>
  697.                             <td>
  698.                           <table width='100%' cellspacing='1' cellpadding='0' align='center' border='0' id='table1'>
  699.                            <tr>
  700.                             <td>
  701.                              <table width='100%' cellspacing='2' cellpadding='3' align='center' border='0'>
  702.                              <tr>
  703.                                <td>
  704.                                     <b>The following errors must be rectified before continuing!</b><br>Please go back and try again!
  705.                                     <br><br>
  706.                                     $msg
  707.                                 </td>
  708.                              </tr>
  709.                             </table>
  710.                           </td>
  711.                          </tr>
  712.                         </table>
  713.                        </td>
  714.                       </tr>
  715.                      </table>";
  716.     
  717.     
  718.     
  719.     $template->output();
  720. }
  721.  
  722. //+--------------------------------------------------------------------------
  723. // CLASSES
  724. //+--------------------------------------------------------------------------
  725.  
  726.  
  727.  
  728. class template
  729. {
  730.     var $contents = "";
  731.     
  732.     function output()
  733.     {
  734.         echo $this->contents;
  735.         echo "   
  736.                  </table>
  737.                  <br><br><center><span id='copy'>© 2002 Invision Board (www.invisionboard.com)</span></center>
  738.                  
  739.                  </body>
  740.                  </html>";
  741.         exit();
  742.     }
  743.     
  744.     //--------------------------------------
  745.  
  746.     function print_top($title="")
  747.     {
  748.     
  749.         $this->contents = "<html>
  750.                   <head><title>Invision Board Set Up :: $title </title>
  751.                   <style type='text/css'>
  752.                       TABLE, TR, TD     { font-family:Verdana, Arial;font-size: 11px; color:#333333 }
  753.                     BODY      { font: 11px Verdana; color:#333333 }
  754.                     a:link, a:visited, a:active  { color:#000055 }
  755.                     a:hover                      { color:#333377;text-decoration:underline }
  756.                     
  757.                     #title  { font-size:10px; font-weight:bold; line-height:150%; color:#FFFFFF; height: 24px; background-image: url(html/sys-img/top_cell.gif); }
  758.                     #title  a:link, #title  a:visited, #title  a:active { text-decoration: underline; color : #FFFFFF; font-size:11px }
  759.                     
  760.                     #detail { font-family: Arial; font-size:11px; color: #333333 }
  761.                     
  762.                      #large { font-family: verdana, arial; font-size:20px; color:#4C77B6; font-weight:bold; letter-spacing:-1px }
  763.                      
  764.                     #subtitle { font-family: Verdana; font-size:22px; color:#4C77B6; font-weight:bold }
  765.                     
  766.                     #warning { font-family: Verdana; font-size:22px; color:#FF0000; font-weight:bold }
  767.                     
  768.                     #table1 {  background-color:#F1F1F1; width:100%; align:center; border:1px solid black }
  769.                     
  770.                     #tdrow1 { background-color:#F3F3EE }
  771.                     
  772.                     #tdrow2 { background-color:#EBEBE4 }
  773.                     
  774.                     #catrow  { font-size:10px; font-weight:bold; line-height:150%; color:#4C77B6; background-color:#C2CFDF; }
  775.                     
  776.                     #tablewrap {  border:1px dashed #777777; background-color:#EFEFEF }
  777.                     
  778.                     #copy { color:#555555; font-size:9px }
  779.                     
  780.                     #tdtop  { font-weight:bold; height:20px; line-height:150%; color:#FFFFFF; background-image: url(html/sys-img/top_cell.gif); }
  781.                     
  782.                     #green    { background-color: #caf2d9 }
  783.                     #red      { background-color: #f5cdcd }
  784.                     
  785.                     #button   { background-color: #4C77B6; color: #FFFFFF; font-family:Verdana, Arial; font-size:11px }
  786.                     
  787.                     #textinput { background-color: #EEEEEE; color:â•©#000000; font-family:Verdana, Arial; font-size:10px; width:100% }
  788.                     
  789.                     #dropdown { background-color: #EEEEEE; color:â•©#000000; font-family:Verdana, Arial; font-size:10px }
  790.                     
  791.                     #multitext { background-color: #EEEEEE; color:â•©#000000; font-family:Courier, Verdana, Arial; font-size:10px }
  792.                     
  793.                   </style>
  794.                   </head>
  795.                  <body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0' bgcolor='#FFFFFF'>
  796.                  
  797.                  <table width='100%' height='70' cellpadding='0' cellspacing='0' border='0'>
  798.                     <tr bgcolor='#4C77B6'>
  799.                         <td width='370' align='left' bgcolor='#4C77B6'><img src='html/sys-img/title.gif' width='370' height='70'></td>
  800.                     </tr>
  801.                 </table>
  802.                 <br>
  803.                 <table width='90%' cellpadding='0' cellspacing='0' border='0' align='center'>
  804.                  ";
  805.                          
  806.     }
  807.  
  808.  
  809. }
  810.  
  811.  
  812. class installer
  813. {
  814.  
  815.     function parse_incoming()
  816.     {
  817.         global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_CLIENT_IP, $REQUEST_METHOD, $REMOTE_ADDR, $HTTP_PROXY_USER, $HTTP_X_FORWARDED_FOR;
  818.         $return = array();
  819.         
  820.         if( is_array($HTTP_GET_VARS) )
  821.         {
  822.             while( list($k, $v) = each($HTTP_GET_VARS) )
  823.             {
  824.                 //$k = $this->clean_key($k);
  825.                 if( is_array($HTTP_GET_VARS[$k]) )
  826.                 {
  827.                     while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) )
  828.                     {
  829.                         $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2);
  830.                     }
  831.                 }
  832.                 else
  833.                 {
  834.                     $return[$k] = $this->clean_value($v);
  835.                 }
  836.             }
  837.         }
  838.         
  839.         // Overwrite GET data with post data
  840.         
  841.         if( is_array($HTTP_POST_VARS) )
  842.         {
  843.             while( list($k, $v) = each($HTTP_POST_VARS) )
  844.             {
  845.                 //$k = $this->clean_key($k);
  846.                 if ( is_array($HTTP_POST_VARS[$k]) )
  847.                 {
  848.                     while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) )
  849.                     {
  850.                         $return[$k][ $this->clean_key($k2) ] = $this->clean_value($v2);
  851.                     }
  852.                 }
  853.                 else
  854.                 {
  855.                     $return[$k] = $this->clean_value($v);
  856.                 }
  857.             }
  858.         }
  859.         
  860.         return $return;
  861.     }
  862.     
  863.     function clean_key($key) {
  864.     
  865.         if ($key == "")
  866.         {
  867.             return "";
  868.         }
  869.         
  870.         $key = preg_replace( "/\.\./"           , ""  , $key );
  871.         $key = preg_replace( "/\_\_(.+?)\_\_/"  , ""  , $key );
  872.         $key = preg_replace( "/^([\w\.\-\_]+)$/", "$1", $key );
  873.         return $key;
  874.     }
  875.     
  876.     function clean_value($val) {
  877.     
  878.         if ($val == "")
  879.         {
  880.             return "";
  881.         }
  882.         
  883.         $val = preg_replace( "/&/"         , "&"         , $val );
  884.         $val = preg_replace( "/<!--/"      , "<!--"  , $val );
  885.         $val = preg_replace( "/-->/"       , "-->"       , $val );
  886.         $val = preg_replace( "/<script/i"  , "<script"   , $val );
  887.         $val = preg_replace( "/>/"         , ">"          , $val );
  888.         $val = preg_replace( "/</"         , "<"          , $val );
  889.         $val = preg_replace( "/\"/"        , """        , $val );
  890.         $val = preg_replace( "/\|/"        , "|"        , $val );
  891.         $val = preg_replace( "/\n/"        , "<br>"          , $val ); // Convert literal newlines
  892.         $val = preg_replace( "/\\\$/"      , "$"        , $val );
  893.         $val = preg_replace( "/\r/"        , ""              , $val ); // Remove literal carriage returns
  894.         $val = preg_replace( "/!/"         , "!"         , $val );
  895.         $val = preg_replace( "/'/"         , "'"         , $val ); // IMPORTANT: It helps to increase sql query safety.
  896.         $val = stripslashes($val);                                     // Swop PHP added backslashes
  897.         $val = preg_replace( "/\\\/"       , "\"        , $val ); // Swop user inputted backslashes
  898.         return $val;
  899.     }
  900.    
  901. }
  902.  
  903.  
  904.  
  905. // DATA AND STUFF, ETC
  906.  
  907. function get_sql()
  908. {
  909.  
  910. $SQL = array();
  911.  
  912. $SQL[] = "CREATE TABLE ibf_admin_sessions (
  913.   ID varchar(32) NOT NULL default '',
  914.   IP_ADDRESS varchar(32) NOT NULL default '',
  915.   MEMBER_NAME varchar(32) NOT NULL default '',
  916.   MEMBER_ID varchar(32) NOT NULL default '',
  917.   SESSION_KEY varchar(32) NOT NULL default '',
  918.   LOCATION varchar(64) default 'index',
  919.   LOG_IN_TIME int(10) NOT NULL default '0',
  920.   RUNNING_TIME int(10) NOT NULL default '0',
  921.   PRIMARY KEY  (ID)
  922. )";
  923.  
  924.  
  925. $SQL[] = "CREATE TABLE ibf_attachments (
  926.   id bigint(20) NOT NULL auto_increment,
  927.   mime_type varchar(128) default NULL,
  928.   file_name varchar(64) default NULL,
  929.   PRIMARY KEY  (id)
  930. )";
  931.  
  932.  
  933. $SQL[] = "CREATE TABLE ibf_badwords (
  934.   wid int(3) NOT NULL auto_increment,
  935.   type varchar(250) NOT NULL default '',
  936.   swop varchar(250) default NULL,
  937.   m_exact tinyint(1) default '0',
  938.   PRIMARY KEY  (wid)
  939. )";
  940.  
  941.  
  942. $SQL[] = "CREATE TABLE ibf_categories (
  943.   id tinyint(3) NOT NULL default '0',
  944.   position tinyint(3) default NULL,
  945.   state varchar(10) default NULL,
  946.   name varchar(128) NOT NULL default '',
  947.   description text,
  948.   image varchar(128) default NULL,
  949.   url varchar(128) default NULL,
  950.   PRIMARY KEY  (id)
  951. )";
  952.  
  953.  
  954.  
  955. $SQL[] = "CREATE TABLE ibf_contacts (
  956.   id bigint(20) NOT NULL auto_increment,
  957.   contact_id varchar(32) NOT NULL default '',
  958.   member_id varchar(32) NOT NULL default '',
  959.   contact_name varchar(32) NOT NULL default '',
  960.   allow_msg tinyint(1) default NULL,
  961.   contact_desc varchar(50) default NULL,
  962.   PRIMARY KEY  (id)
  963. )";
  964.  
  965.  
  966.  
  967. $SQL[] = "CREATE TABLE ibf_css (
  968.   cssid int(10) NOT NULL auto_increment,
  969.   css_name varchar(128) NOT NULL default '',
  970.   css_text text,
  971.   PRIMARY KEY  (cssid)
  972. )";
  973.  
  974.  
  975.  
  976. $SQL[] = "CREATE TABLE ibf_emoticons (
  977.   id smallint(3) NOT NULL auto_increment,
  978.   typed varchar(32) NOT NULL default '',
  979.   image varchar(128) NOT NULL default '',
  980.   clickable smallint(2) NOT NULL default '1',
  981.   PRIMARY KEY  (id)
  982. )";
  983.  
  984.  
  985.  
  986. $SQL[] = "CREATE TABLE ibf_faq (
  987.   id bigint(20) NOT NULL auto_increment,
  988.   title varchar(128) NOT NULL default '',
  989.   text text,
  990.   description text NOT NULL,
  991.   PRIMARY KEY  (id)
  992. )";
  993.  
  994.  
  995.  
  996. $SQL[] = "CREATE TABLE ibf_forums (
  997.   id smallint(5) NOT NULL default '0',
  998.   topics mediumint(6) default NULL,
  999.   posts mediumint(6) default NULL,
  1000.   last_post int(10) default NULL,
  1001.   last_poster_id varchar(32) default NULL,
  1002.   last_poster_name varchar(32) default NULL,
  1003.   name varchar(128) NOT NULL default '',
  1004.   description text,
  1005.   position tinyint(2) default NULL,
  1006.   use_ibc tinyint(1) default NULL,
  1007.   use_html tinyint(1) default NULL,
  1008.   status varchar(10) default NULL,
  1009.   start_perms varchar(32) default NULL,
  1010.   reply_perms varchar(32) default NULL,
  1011.   read_perms varchar(32) default NULL,
  1012.   password varchar(32) default NULL,
  1013.   category tinyint(2) NOT NULL default '0',
  1014.   last_title varchar(128) default NULL,
  1015.   last_id smallint(5) default NULL,
  1016.   sort_key varchar(32) default NULL,
  1017.   sort_order varchar(32) default NULL,
  1018.   prune tinyint(3) default NULL,
  1019.   show_rules tinyint(1) default NULL,
  1020.   use_attach tinyint(1) default NULL,
  1021.   preview_posts tinyint(1) default NULL,
  1022.   allow_poll tinyint(1) NOT NULL default '1',
  1023.   allow_pollbump tinyint(1) NOT NULL default '0',
  1024.   inc_postcount tinyint(1) NOT NULL default '1',
  1025.   skin_id int(10) default NULL,
  1026.   parent_id mediumint(5) default '-1',
  1027.   subwrap tinyint(1) default '0',
  1028.   PRIMARY KEY  (id),
  1029.   KEY category (category)
  1030. )";
  1031.  
  1032.  
  1033.  
  1034. $SQL[] = "CREATE TABLE ibf_groups (
  1035.   g_id int(3) unsigned NOT NULL auto_increment,
  1036.   g_view_board tinyint(1) default NULL,
  1037.   g_mem_info tinyint(1) default NULL,
  1038.   g_other_topics tinyint(1) default NULL,
  1039.   g_use_search tinyint(1) default NULL,
  1040.   g_email_friend tinyint(1) default NULL,
  1041.   g_invite_friend tinyint(1) default NULL,
  1042.   g_edit_profile tinyint(1) default NULL,
  1043.   g_post_new_topics tinyint(1) default NULL,
  1044.   g_reply_own_topics tinyint(1) default NULL,
  1045.   g_reply_other_topics tinyint(1) default NULL,
  1046.   g_edit_posts tinyint(1) default NULL,
  1047.   g_delete_own_posts tinyint(1) default NULL,
  1048.   g_open_close_posts tinyint(1) default NULL,
  1049.   g_delete_own_topics tinyint(1) default NULL,
  1050.   g_post_polls tinyint(1) default NULL,
  1051.   g_vote_polls tinyint(1) default NULL,
  1052.   g_use_pm tinyint(1) default NULL,
  1053.   g_is_supmod tinyint(1) default NULL,
  1054.   g_access_cp tinyint(1) default NULL,
  1055.   g_title varchar(32) NOT NULL default '',
  1056.   g_can_remove tinyint(1) default NULL,
  1057.   g_append_edit tinyint(1) default NULL,
  1058.   g_access_offline tinyint(1) default NULL,
  1059.   g_avoid_q tinyint(1) default NULL,
  1060.   g_avoid_flood tinyint(1) default NULL,
  1061.   g_icon varchar(64) default NULL,
  1062.   g_attach_max bigint(20) default NULL,
  1063.   g_avatar_upload tinyint(1) default '0',
  1064.   g_calendar_post tinyint(1) default '0',
  1065.   prefix varchar(250) default NULL,
  1066.   suffix varchar(250) default NULL,
  1067.   PRIMARY KEY  (g_id)
  1068. )";
  1069.  
  1070.  
  1071.  
  1072. $SQL[] = "CREATE TABLE ibf_images (
  1073.   imid int(10) NOT NULL auto_increment,
  1074.   setname varchar(125) NOT NULL default '',
  1075.   A_LOCKED_B varchar(250) default NULL,
  1076.   A_MOVED_B varchar(250) default NULL,
  1077.   A_POLL varchar(250) default NULL,
  1078.   A_POLLONLY_B varchar(250) default NULL,
  1079.   A_POST varchar(250) default NULL,
  1080.   A_REPLY varchar(250) default NULL,
  1081.   A_STAR varchar(250) default NULL,
  1082.   B_HOT varchar(250) default NULL,
  1083.   B_HOT_NN varchar(250) default NULL,
  1084.   B_LOCKED varchar(250) default NULL,
  1085.   B_MOVED varchar(250) default NULL,
  1086.   B_NEW varchar(250) default NULL,
  1087.   B_NORM varchar(250) default NULL,
  1088.   B_PIN varchar(250) default NULL,
  1089.   B_POLL varchar(250) default NULL,
  1090.   B_POLL_NN varchar(250) default NULL,
  1091.   C_LOCKED varchar(250) default NULL,
  1092.   C_OFF varchar(250) default NULL,
  1093.   C_OFF_CAT varchar(250) default NULL,
  1094.   C_OFF_RES varchar(250) default NULL,
  1095.   C_ON varchar(250) default NULL,
  1096.   C_ON_CAT varchar(250) default NULL,
  1097.   C_ON_RES varchar(250) default NULL,
  1098.   F_ACTIVE varchar(250) default NULL,
  1099.   F_NAV_SEP varchar(250) default NULL,
  1100.   F_NAV varchar(250) default NULL,
  1101.   F_STATS varchar(250) default NULL,
  1102.   GO_LAST_ON varchar(250) default NULL,
  1103.   GO_LAST_OFF varchar(250) default NULL,
  1104.   M_ADDMEM varchar(250) default NULL,
  1105.   M_DELETE varchar(250) default NULL,
  1106.   M_READ varchar(250) default NULL,
  1107.   M_REPLY varchar(250) default NULL,
  1108.   M_UNREAD varchar(250) default NULL,
  1109.   P_AOL varchar(250) default NULL,
  1110.   P_DELETE varchar(250) default NULL,
  1111.   P_EDIT varchar(250) default NULL,
  1112.   P_EMAIL varchar(250) default NULL,
  1113.   P_ICQ varchar(250) default NULL,
  1114.   P_MSG varchar(250) default NULL,
  1115.   P_PROFILE varchar(250) default NULL,
  1116.   P_QUOTE varchar(250) default NULL,
  1117.   P_WEBSITE varchar(250) default NULL,
  1118.   CAT_IMG varchar(250) default NULL,
  1119.   B_HOT_DOT varchar(250) default NULL,
  1120.   B_NEW_DOT varchar(250) default NULL,
  1121.   B_HOT_NN_DOT varchar(250) default NULL,
  1122.   B_NORM_DOT varchar(250) default NULL,
  1123.   B_POLL_DOT varchar(250) default NULL,
  1124.   B_POLL_NN_DOT varchar(250) default NULL,
  1125.   NEW_POST varchar(250) default NULL,
  1126.   PRIMARY KEY  (imid)
  1127. )";
  1128.  
  1129.  
  1130.  
  1131. $SQL[] = "CREATE TABLE ibf_member_extra (
  1132.   id bigint(20) NOT NULL default '0',
  1133.   notes text,
  1134.   links text,
  1135.   bio text,
  1136.   ta_size char(3) default NULL,
  1137.   PRIMARY KEY  (id)
  1138. )";
  1139.  
  1140.  
  1141.  
  1142. $SQL[] = "CREATE TABLE ibf_members (
  1143.   id bigint(10) NOT NULL default '0',
  1144.   name varchar(32) NOT NULL default '',
  1145.   mgroup tinyint(2) NOT NULL default '0',
  1146.   password varchar(32) NOT NULL default '',
  1147.   email varchar(60) NOT NULL default '',
  1148.   joined int(10) NOT NULL default '0',
  1149.   ip_address varchar(16) NOT NULL default '',
  1150.   avatar varchar(128) default NULL,
  1151.   avatar_size varchar(9) default NULL,
  1152.   posts mediumint(7) default '0',
  1153.   photo varchar(70) default NULL,
  1154.   aim_name varchar(40) default NULL,
  1155.   icq_number varchar(40) default NULL,
  1156.   location varchar(128) default NULL,
  1157.   signature text,
  1158.   website varchar(70) default NULL,
  1159.   yahoo varchar(32) default NULL,
  1160.   title varchar(64) default NULL,
  1161.   allow_admin_mails tinyint(1) default NULL,
  1162.   time_offset varchar(10) default NULL,
  1163.   interests text,
  1164.   hide_email varchar(8) default NULL,
  1165.   email_pm tinyint(1) default NULL,
  1166.   email_full tinyint(1) default NULL,
  1167.   skin smallint(5) default NULL,
  1168.   warn_level int(10) default NULL,
  1169.   language varchar(32) default NULL,
  1170.   msnname varchar(64) default NULL,
  1171.   last_post int(10) default NULL,
  1172.   allow_post tinyint(1) default '1',
  1173.   view_sigs tinyint(1) default '1',
  1174.   view_img tinyint(1) default '1',
  1175.   view_avs tinyint(1) default '1',
  1176.   view_pop tinyint(1) default '1',
  1177.   bday_day int(2) default NULL,
  1178.   bday_month int(2) default NULL,
  1179.   bday_year int(4) default NULL,
  1180.   new_msg tinyint(2) default NULL,
  1181.   msg_from_id varchar(32) default NULL,
  1182.   msg_msg_id int(10) default NULL,
  1183.   msg_total smallint(5) default NULL,
  1184.   vdirs text,
  1185.   show_popup tinyint(1) default NULL,
  1186.   validate_key varchar(32) default NULL,
  1187.   prev_group smallint(3) default '0',
  1188.   new_pass varchar(32) default NULL,
  1189.   misc varchar(128) default NULL,
  1190.   last_visit int(10) default '0',
  1191.   last_activity int(10) default '0',
  1192.   dst_in_use TINYINT (1) DEFAULT '0',
  1193.   PRIMARY KEY  (id),
  1194.   KEY name (name),
  1195.   KEY mgroup (mgroup)
  1196. )";
  1197.  
  1198.  
  1199. $SQL[] = "CREATE TABLE ibf_messages (
  1200.   msg_id bigint(20) NOT NULL auto_increment,
  1201.   msg_date int(10) default NULL,
  1202.   read_state tinyint(1) default NULL,
  1203.   title varchar(128) default NULL,
  1204.   message text,
  1205.   from_id varchar(32) default NULL,
  1206.   vid varchar(32) default NULL,
  1207.   member_id varchar(32) NOT NULL default '0',
  1208.   recipient_id varchar(32) default NULL,
  1209.   attach_type tinyint(128) default NULL,
  1210.   attach_file tinyint(128) default NULL,
  1211.   PRIMARY KEY  (msg_id),
  1212.   KEY member_id (member_id)
  1213. )";
  1214.  
  1215.  
  1216.  
  1217. $SQL[] = "CREATE TABLE ibf_moderator_logs (
  1218.   id bigint(20) NOT NULL auto_increment,
  1219.   forum_id int(5) default '0',
  1220.   topic_id bigint(20) default '0',
  1221.   post_id bigint(20) default '0',
  1222.   member_id varchar(32) NOT NULL default '',
  1223.   member_name varchar(32) NOT NULL default '',
  1224.   ip_address varchar(32) default NULL,
  1225.   http_referer varchar(255) default NULL,
  1226.   ctime int(10) default NULL,
  1227.   topic_title varchar(128) default NULL,
  1228.   action varchar(128) default NULL,
  1229.   query_string varchar(128) default NULL,
  1230.   PRIMARY KEY  (id)
  1231. )";
  1232.  
  1233.  
  1234. $SQL[] = "CREATE TABLE ibf_moderators (
  1235.   mid bigint(20) NOT NULL auto_increment,
  1236.   forum_id int(5) NOT NULL default '0',
  1237.   member_name varchar(32) NOT NULL default '',
  1238.   member_id varchar(32) NOT NULL default '0',
  1239.   edit_post tinyint(1) default NULL,
  1240.   edit_topic tinyint(1) default NULL,
  1241.   delete_post tinyint(1) default NULL,
  1242.   delete_topic tinyint(1) default NULL,
  1243.   view_ip tinyint(1) default NULL,
  1244.   open_topic tinyint(1) default NULL,
  1245.   close_topic tinyint(1) default NULL,
  1246.   mass_move tinyint(1) default NULL,
  1247.   mass_prune tinyint(1) default NULL,
  1248.   move_topic tinyint(1) default NULL,
  1249.   pin_topic tinyint(1) default NULL,
  1250.   unpin_topic tinyint(1) default NULL,
  1251.   post_q tinyint(1) default NULL,
  1252.   topic_q tinyint(1) default NULL,
  1253.   allow_warn tinyint(1) default NULL,
  1254.   edit_user tinyint(1) NOT NULL default '0',
  1255.   PRIMARY KEY  (mid)
  1256. )";
  1257.  
  1258.  
  1259.  
  1260. $SQL[] = "CREATE TABLE ibf_polls (
  1261.   pid bigint(20) NOT NULL auto_increment,
  1262.   tid bigint(20) NOT NULL default '0',
  1263.   start_date int(10) default NULL,
  1264.   choices text,
  1265.   starter_id varchar(32) default NULL,
  1266.   votes bigint(20) default NULL,
  1267.   forum_id bigint(20) default NULL,
  1268.   PRIMARY KEY  (pid)
  1269. )";
  1270.  
  1271.  
  1272.  
  1273. $SQL[] = "CREATE TABLE ibf_posts (
  1274.   pid bigint(20) NOT NULL auto_increment,
  1275.   author_id int(10) NOT NULL default '0',
  1276.   author_name varchar(32) default NULL,
  1277.   use_sig varchar(8) default NULL,
  1278.   use_emo varchar(8) default NULL,
  1279.   ip_address varchar(32) default NULL,
  1280.   post_date int(10) default NULL,
  1281.   icon_id smallint(3) default NULL,
  1282.   post text,
  1283.   queued tinyint(1) default NULL,
  1284.   topic_id bigint(20) NOT NULL,
  1285.   forum_id int(10) NOT NULL,
  1286.   attach_id varchar(64) default NULL,
  1287.   attach_hits int(10) default NULL,
  1288.   attach_type varchar(128) default NULL,
  1289.   attach_file varchar(255) default NULL,
  1290.   post_title varchar(255) default NULL,
  1291.   new_topic tinyint(1) default '0',
  1292.   PRIMARY KEY  (pid),
  1293.   KEY forum_id (forum_id),
  1294.   KEY topic_id (topic_id,author_id),
  1295.   KEY author_id (author_id)
  1296. )";
  1297.  
  1298.  
  1299.  
  1300. $SQL[] = "CREATE TABLE ibf_rules (
  1301.   fid mediumint(6) NOT NULL default '0',
  1302.   title varchar(128) NOT NULL default '',
  1303.   body text,
  1304.   updated int(10) default NULL,
  1305.   show_all tinyint(1) default NULL,
  1306.   PRIMARY KEY  (fid)
  1307. )";
  1308.  
  1309.  
  1310. $SQL[] = "CREATE TABLE ibf_search_results (
  1311.   id varchar(32) NOT NULL default '',
  1312.   topics text NOT NULL,
  1313.   search_date int(12) NOT NULL default '0',
  1314.   max_hits int(3) NOT NULL default '0',
  1315.   sort_key varchar(32) NOT NULL default 'last_post',
  1316.   sort_order varchar(4) NOT NULL default 'desc'
  1317. )";
  1318.  
  1319.  
  1320. $SQL[] = "CREATE TABLE ibf_sessions (
  1321.   id varchar(32) NOT NULL default '0',
  1322.   member_name varchar(64) default NULL,
  1323.   member_pass varchar(32) default NULL,
  1324.   member_id varchar(32) default NULL,
  1325.   ip_address varchar(16) default NULL,
  1326.   start_session int(10) default NULL,
  1327.   browser varchar(64) default NULL,
  1328.   running_time int(10) default NULL,
  1329.   login_type tinyint(1) default NULL,
  1330.   location varchar(40) default NULL,
  1331.   member_group smallint(3) default NULL,
  1332.   PRIMARY KEY  (id)
  1333. )";
  1334.  
  1335.  
  1336. $SQL[] = "CREATE TABLE ibf_skins (
  1337.   uid int(10) NOT NULL auto_increment,
  1338.   sname varchar(100) NOT NULL default '',
  1339.   sid int(10) NOT NULL default '0',
  1340.   set_id int(5) NOT NULL default '0',
  1341.   tmpl_id int(10) NOT NULL default '0',
  1342.   img_id int(10) NOT NULL default '1',
  1343.   css_id int(10) NOT NULL default '1',
  1344.   tbl_width varchar(250) default NULL,
  1345.   tbl_border varchar(250) default NULL,
  1346.   hidden tinyint(1) NOT NULL default '0',
  1347.   default_set tinyint(1) NOT NULL default '0',
  1348.   PRIMARY KEY  (uid)
  1349. )";
  1350.  
  1351.  
  1352.  
  1353. $SQL[] = "CREATE TABLE ibf_stats (
  1354.   TOTAL_REPLIES bigint(20) NOT NULL default '0',
  1355.   TOTAL_TOPICS bigint(20) NOT NULL default '0',
  1356.   LAST_MEM_NAME varchar(32) default NULL,
  1357.   LAST_MEM_ID varchar(32) default NULL,
  1358.   MOST_DATE int(10) default NULL,
  1359.   MOST_COUNT int(10) default '0',
  1360.   MEM_COUNT bigint(20) default '0'
  1361. )";
  1362.  
  1363.  
  1364.  
  1365. $SQL[] = "CREATE TABLE ibf_templates (
  1366.   tmid int(10) NOT NULL auto_increment,
  1367.   template mediumtext,
  1368.   name varchar(128) default NULL,
  1369.   PRIMARY KEY  (tmid)
  1370. )";
  1371.  
  1372.  
  1373. $SQL[] = "CREATE TABLE ibf_titles (
  1374.   id smallint(5) NOT NULL auto_increment,
  1375.   posts int(10) default NULL,
  1376.   title varchar(128) default NULL,
  1377.   pips varchar(128) default NULL,
  1378.   PRIMARY KEY  (id)
  1379. )";
  1380.  
  1381.  
  1382. $SQL[] = "CREATE TABLE ibf_tmpl_names (
  1383.   skid int(10) NOT NULL auto_increment,
  1384.   skname varchar(60) NOT NULL default 'Invision Board',
  1385.   author varchar(250) default '',
  1386.   email varchar(250) default '',
  1387.   url varchar(250) default '',
  1388.   PRIMARY KEY  (skid)
  1389. )";
  1390.  
  1391.  
  1392.  
  1393. $SQL[] = "CREATE TABLE ibf_topics (
  1394.   tid bigint(20) NOT NULL auto_increment,
  1395.   title varchar(70) NOT NULL default '',
  1396.   description varchar(70) default NULL,
  1397.   state varchar(8) default NULL,
  1398.   posts smallint(4) default NULL,
  1399.   starter_id varchar(32) default NULL,
  1400.   start_date int(10) default NULL,
  1401.   last_poster_id varchar(32) default NULL,
  1402.   last_post int(10) default NULL,
  1403.   icon_id tinyint(2) default NULL,
  1404.   starter_name varchar(32) default NULL,
  1405.   last_poster_name varchar(32) default NULL,
  1406.   poll_state varchar(8) default NULL,
  1407.   last_vote int(10) default NULL,
  1408.   views smallint(5) default NULL,
  1409.   forum_id smallint(5) NOT NULL,
  1410.   approved tinyint(1) default NULL,
  1411.   author_mode tinyint(1) default NULL,
  1412.   pinned tinyint(1) default NULL,
  1413.   moved_to varchar(64) default NULL,
  1414.   rating text,
  1415.   total_votes int(5) NOT NULL default '0',
  1416.   PRIMARY KEY  (tid),
  1417.   KEY forum_id (forum_id)
  1418. )";
  1419.  
  1420.  
  1421. $SQL[] = "CREATE TABLE ibf_tracker (
  1422.   trid bigint(20) NOT NULL auto_increment,
  1423.   member_id varchar(32) NOT NULL default '',
  1424.   topic_id bigint(20) NOT NULL default '0',
  1425.   start_date int(10) default NULL,
  1426.   last_sent int(10) NOT NULL default '0',
  1427.   PRIMARY KEY  (trid)
  1428. )";
  1429.  
  1430.  
  1431.  
  1432. $SQL[] = "CREATE TABLE ibf_voters (
  1433.   vid bigint(20) NOT NULL auto_increment,
  1434.   ip_address varchar(16) NOT NULL default '',
  1435.   vote_date int(10) NOT NULL default '0',
  1436.   tid bigint(20) NOT NULL default '0',
  1437.   member_id varchar(32) default NULL,
  1438.   forum_id bigint(20) default NULL,
  1439.   PRIMARY KEY  (vid)
  1440. )";
  1441.  
  1442. $SQL[] = "CREATE TABLE ibf_languages (
  1443.     lid bigint(20) NOT NULL auto_increment,
  1444.     ldir varchar(64) NOT NULL,
  1445.     lname varchar(250) NOT NULL,
  1446.     lauthor varchar(250) default NULL,
  1447.     lemail varchar(250) default NULL,
  1448.     PRIMARY KEY (lid)
  1449. )";
  1450.  
  1451.  
  1452. $SQL[] = "INSERT INTO ibf_categories (id, position, state, name, description, image, url) VALUES (-1, NULL, NULL, '-', NULL, NULL, NULL)";
  1453.  
  1454. $SQL[] = "INSERT INTO ibf_css (cssid, css_name, css_text) VALUES (1, 'Invision Style Sheet', NULL)";
  1455.  
  1456. $SQL[] = "INSERT INTO ibf_emoticons VALUES (1, ':mellow:', 'mellow.gif', 0)";
  1457. $SQL[] = "INSERT INTO ibf_emoticons VALUES (2, ':huh:', 'huh.gif', 1)";
  1458. $SQL[] = "INSERT INTO ibf_emoticons VALUES (3, '^_^', 'happy.gif', 0)";
  1459. $SQL[] = "INSERT INTO ibf_emoticons VALUES (4, ':o', 'ohmy.gif', 1)";
  1460. $SQL[] = "INSERT INTO ibf_emoticons VALUES (5, ';)', 'wink.gif', 1)";
  1461. $SQL[] = "INSERT INTO ibf_emoticons VALUES (6, ':P', 'tongue.gif', 1)";
  1462. $SQL[] = "INSERT INTO ibf_emoticons VALUES (7, ':D', 'biggrin.gif', 1)";
  1463. $SQL[] = "INSERT INTO ibf_emoticons VALUES (8, ':lol:', 'laugh.gif', 1)";
  1464. $SQL[] = "INSERT INTO ibf_emoticons VALUES (9, 'B)', 'cool.gif', 1)";
  1465. $SQL[] = "INSERT INTO ibf_emoticons VALUES (10, ':rolleyes:', 'rolleyes.gif', 1)";
  1466. $SQL[] = "INSERT INTO ibf_emoticons VALUES (11, '-_-', 'sleep.gif', 0)";
  1467. $SQL[] = "INSERT INTO ibf_emoticons VALUES (12, '<_<', 'dry.gif', 1)";
  1468. $SQL[] = "INSERT INTO ibf_emoticons VALUES (13, ':)', 'smile.gif', 1)";
  1469. $SQL[] = "INSERT INTO ibf_emoticons VALUES (14, ':wub:', 'wub.gif', 0)";
  1470. $SQL[] = "INSERT INTO ibf_emoticons VALUES (15, ':angry:', 'mad.gif', 1)";
  1471. $SQL[] = "INSERT INTO ibf_emoticons VALUES (16, ':(', 'sad.gif', 1)";
  1472. $SQL[] = "INSERT INTO ibf_emoticons VALUES (17, ':unsure:', 'unsure.gif', 1)";
  1473. $SQL[] = "INSERT INTO ibf_emoticons VALUES (18, ':wacko:', 'wacko.gif', 0)";
  1474. $SQL[] = "INSERT INTO ibf_emoticons VALUES (19, ':blink:', 'blink.gif', 1)";
  1475. $SQL[] = "INSERT INTO ibf_emoticons VALUES (20, ':ph34r:', 'ph34r.gif', 1)";
  1476.  
  1477. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (1, 'Registration benefits', 'To be able to use all the features on this board, the administrator will probably require that you register for a member account. Registration is free and only takes a moment to complete.\r<br>\r<br>During registration, the adminstrator requires that you supply a valid email address. This is important as the administrator may require that you validate your registration via an email. If this is the case, you will be notified when registering.\r<br>In some cases, the administrator will need to approve your regsitration before you can use your member account fully. If this is the case you will be notified during registration.\r<br>\r<br>Once you have registered and logged in, you will have access to your private messenger and your control panel.\r<br>\r<br>For more information on these items, please see the relevant sections in this documentation.', 'How to register and the added benefits of being a registered member.')";
  1478. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (2, 'Cookies and cookie usage', 'Using cookies is optional, but strongly recommended. Cookies are used to track topics, showing you which topics have new replies since your last visit and to automatically log you in when you return.\r<br>\r<br>This board will also allow you to remove the long session id\'s found in the URL\'s. You can do this by entering your control panel (click the link at the top of the board) and entering the \'Board Settings\' section. It is recommended that you enable this feature because you may experience problems if your internet connection shares a proxy and you share a link with another user. If in doubt, choose to hide the session id.\r<br>\r<br><b>Clearing Cookies</b>\r<br>\r<br>You can clear the cookies at any time by clicking on the link found at the bottom of the main board page (the first page you see when returning to the board). If this does not work for you, you may need to remove the cookies manually.\r<br>\r<br><u>Removing Cookies in Internet Explorer for Windows</u>\r<br>\r<br><ul>\r<br><li> Close all open Internet Explorer Windows\r<br><li> Click on the \'start\' button\r<br><li> Move up to \'Find\' and click on \'Files and Folders\'\r<br><li> When the new window appears, type in the domain name of the board you are using into the \'containing text\' field. (If the boards address was \'http://www.invisionboard.com/forums/index.php\' you would enter \'invisionboard.com\' without the quotes)\r<br><li> In the \'look in\' box, type in <b>C:\Windows\Cookies</b> and press \'Find Now\'\r<br><li> After it has finished searching, highlight all files (click on a file then press CTRL+A) and delete them.\r<br></ul>\r<br>\r<br><u>Removing Cookies in Internet Explorer for Macintosh</u>\r<br>\r<br><ul>\r<br><li> With Internet Explorer active, choose \'Edit\' and then \'Preferences\' from the Macintosh menu bar at the top of the screen\r<br><li> When the preferences panel opens, choose \'Cookies\' found in the \'Receiving Files\' section.\r<br><li> When the cookie pane loads, look for the domain name of the board (If the boards address was \'http://www.invisionboard.com/forums/index.php\' look for \'invisionboard.com\' or \'www.invisionboard.com\'\r<br><li> For each cookie, click on the entry and press the delete button.\r<br></ul>\r<br>\r<br>Your cookies should now be removed. In some cases you may need to restart your computer for the changes to take effect.', 'The benefits of using cookies and how to remove cookies set by this board.')";
  1479. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (3, 'Recovering lost or forgotten passwords', 'Security is a big feature on this board, and to that end, all passwords are encrypted when you register.\r<br>This means that we cannot email your password to you as we hold no record of your \'uncrypted\' password. You can however, apply to have your password reset.\r<br>\r<br>To do this, click on the <a href=\'index.php?act=Reg&CODE=10\'>Lost Password link</a> found on the log in page.\r<br>\r<br>Further instruction is available from there.', 'How to reset your password if you\'ve forgotton it.')";
  1480. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (4, 'Your Control Panel', 'Your control panel is your own private board console. You can change how the board looks and feels as well as your own information from here.\r<br>\r<br><b>Edit Profile Info</b>\r<br>\r<br>This section allows you to add or edit your contact information and enter some personal information if you choose. All of this information is optional and can be omitted.\r<br>\r<br><b>Edit Signature</b>\r<br>\r<br>A board \'signature\' is very similar to an email signature. This signature is attached to the foot of every message you post unless you choose to check the box that allows you to ommit the signature in the message you are posting. You may use BB Code if available and in some cases, pure HTML (if the board administrator allows it).\r<br>\r<br><b>Edit Avatar Settings</b>\r<br>\r<br>An avatar is a little image that appears under your username when you view a topic or post you authored. If the administrator allows, you may either choose from the board gallery, enter a URL to an avatar stored on your server or upload an avatar to use. You may also set the width of the avatar to ensure that it\'s sized in proportion.\r<br>\r<br><b>Email Settings</b>\r<br>\r<br><u>Hide my email address</u> allows you to deny the ability for other users to send you an email from the board.\r<br><u>Send me updates sent by the board administrator</u> will allow the administrator to include your email address in any mailings they send out - this is used mostly for important updates and community information.\r<br><u>Include a copy of the post when emailing me from a subscribed topic</u>, this allows you to have the new post included in any reply to topic notifications.\r<br>\r<br><b>Board Settings</b>\r<br>\r<br>From this section, you can set your timezone, choose to not see users signatures, avatars and posted images.\r<br>You can choose to get a pop up window informing you when you have a new message and hide the long session ID in links (see the \'Cookies\' help file for more infomation on this).\r<br>\r<br><b>Skins and Languages</b>\r<br>\r<br>If available, you can choose a skin style and language choice. This affects how the board is displayed so you may wish to preview the skin before submitting the form.\r<br>\r<br><b>Change Email Address</b>\r<br>\r<br>At any time, you can change the email address that is registered to your account. In some cases, you will need to revalidate your account after changing your email address. If this is the case, you will be notified before your email address change is processed.\r<br>\r<br><b>Change Password</b>\r<br>\r<br>You may change your password from this section. Please note that you will need to know your current password before you can change your password.\r<br>\r<br><b>View Subsciptions</b>\r<br>\r<br>This is where you manage your topic subscriptions. Please see the help file \'Email Notification of new messages\' for more information on how to subscribe to topics.', 'Editing contact information, personal information, avatars, signatures, board settings, languages and style choices.')";
  1481. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (5, 'Email Notification of new messages', 'This board can notify you when a new reply is added to a topic. Many users find this useful to keep up to date on topics without the need to view the board to check for new messages.\r<br>\r<br>To do this, simply click on the \'Track This Topic\' link found at the top and bottom of any topic. When you click this link, the topic will be added to your subscriptions that are managed from your control panel.\r<br>\r<br>Please note that to avoid multiple emails being sent to your email address, you will only get notified once per day of new replies.', 'How to get emailed when a new reply is added to a topic.')";
  1482. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (6, 'Your Personal Messenger', 'Your personal messenger acts much like an email account in that you can send and receive messages and store messages in folders.\r<br>\r<br><b>Send a new PM</b>\r<br>\r<br>This will allow you to send a message to another member. If you have names in your contact list, you can choose a name from it - or you may choose to enter a name in the relevant form field. This will be automatically filled in if you clicked a \'PM\' button on the board (from the memberlist or a post).\r<br>If the administrator allows, you may use BB Code and HTML in your private message. If you choose to check the \'Add a copy of this message to you sent items folder\' box, a copy of the message will be saved for you for later reference. If you check the \'Get notified when this message is read\' box, you will receive a PM informing you when the message was read for your records.\r<br>\r<br><b>Contact List</b>\r<br>\r<br>You may add in users names in this section, or edit any saved entries. You can also use this as a ban list, denying the named member the ability to message you.\r<br>Names entered in this section will appear in the drop down list when sending a new PM, allowing you to quickly choose the members name when sending a message.\r<br>\r<br><b>Edit Folders</b>\r<br>\r<br>You may rename, add or remove folders to store messages is, allowing you to organise your messages to your preference. You cannot remove \'Sent Items\' or \'Inbox\'.\r<br>\r<br><b>Go to Inbox</b>\r<br>\r<br>Your inbox is where all new messages are sent to. Clicking on the message title will show you the message in a similar format to the board topic view. You can also delete or move messages from your inbox.\r<br>\r<br><b>Archive Messages</b>\r<br>\r<br>If your messenger folders are full and you are unable to receive new messages, you can archive them off. This compiles the messages into a single HTML page or Microsoft © Excel Format. This page is then emailed to your registered email address for your convenience.\r<br>\r<br>', 'How to send personal messages, edit your messenger folders and archive stored messages.')";
  1483. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (7, 'Contacting the moderating team', 'If you need to contact a moderator or simply wish to view the complete administration team, you can click the link \'The moderating team\' found at the top of the main board page (the first page you see when visiting the board).\r<br>\r<br>This list will show you administrators (those who have administration control panel access), global moderators (those who can moderate in all forums) and the moderators of the individual forums.\r<br>\r<br>If you wish to contact someone about your member account, then contact an administrator - if you wish to contact someone about a post or topic, contact either a global moderator or the forum moderator.', 'Where to find a list of the board moderators and administrators.')";
  1484. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (8, 'Viewing members profile information', 'You can view a members profile at any time by clicking on their name when it is underlined (as a link) or by clicking on their name in a post within a topic.\r<br>\r<br>This will show you their profile page which contains their contact information (if they have entered some) and their \'active stats\'.', 'How to view members contact information.')";
  1485. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (9, 'Viewing todays active topics', 'You can view which new topics have new replies today by clicking on the \'Todays Active Topics\' link found on the main board page (the first page you see when visiting the board).\r<br>\r<br>You can set your own date critera, choosing to view all topics  with new replies during several date choices.', 'How to view all the topics which have a new reply today')";
  1486. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (10, 'Searching Topics and Posts', 'The search feature is designed to allow you to quickly find topics and posts that contain the keywords you enter.\r<br>\r<br>The \'Simple Search\' option from the drop down box allows you to enter a single keyword or phrase to search by - the advanced option allows you to join keywords with \'AND\', \'OR\' to fine tune the search. Using this option will make the search slightly slower.\r<br>\r<br>The bottom section of the form allows you to further fine tune the search. You can choose a category to search in, or a forum - or choose all forums to search in.\r<br>\r<br>If you enter a name into the \'Search by member name\' section, all posts started or replied in by this member are returned.', 'How to use the search feature.')";
  1487. $SQL[] = "INSERT INTO ibf_faq (id, title, text, description) VALUES (11, 'Logging in and out', 'If you have chosen not to remember your log in details in cookies, or you are accessing the board on another computer, you will need to log into the board to access your member profile and post with your registered name.\r<br>\r<br>When you log in, you have the choice to save cookies that will log you in automatically when you return. Do not use this option on a shared computer for security.\r<br>\r<br>You can also choose to hide - this will keep your name from appearing in the active users list.\r<br>\r<br>Logging out is simply a matter of clicking on the \'Log Out\' link that is displayed when you are logged in. If you find that you are not logged out, you may need to manually remove your cookies. See the \'Cookies\' help file for more information.', 'How to log in and out from the board and how to remain anonymous and not be shown on the active users list.')";
  1488.  
  1489. $SQL[] = "INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (4, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 'Admin', 0, 1, 1, 1, 1, '', 5000, 1, 1, '<span style=\'color:red\'>', '</span>')";
  1490. $SQL[] = "INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (2, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, 'Guests', NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, NULL)";
  1491. $SQL[] = "INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, NULL, NULL, NULL, 1, 1, 1, 0, 0, 'Members', 0, 1, 0, 0, 0, NULL, NULL, 1, 0, NULL, NULL)";
  1492. $SQL[] = "INSERT INTO ibf_groups (g_id, g_view_board, g_mem_info, g_other_topics, g_use_search, g_email_friend, g_invite_friend, g_edit_profile, g_post_new_topics, g_reply_own_topics, g_reply_other_topics, g_edit_posts, g_delete_own_posts, g_open_close_posts, g_delete_own_topics, g_post_polls, g_vote_polls, g_use_pm, g_is_supmod, g_access_cp, g_title, g_can_remove, g_append_edit, g_access_offline, g_avoid_q, g_avoid_flood, g_icon, g_attach_max, g_avatar_upload, g_calendar_post, prefix, suffix) VALUES (1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Validating', 0, 1, 0, 0, 0, NULL, 0, 0, 0, NULL, NULL)";
  1493.  
  1494. $SQL[] = "INSERT INTO ibf_images (imid, setname, A_LOCKED_B, A_MOVED_B, A_POLL, A_POLLONLY_B, A_POST, A_REPLY, A_STAR, B_HOT, B_HOT_NN, B_LOCKED, B_MOVED, B_NEW, B_NORM, B_PIN, B_POLL, B_POLL_NN, C_LOCKED, C_OFF, C_OFF_CAT, C_OFF_RES, C_ON, C_ON_CAT, C_ON_RES, F_ACTIVE, F_NAV_SEP, F_NAV, F_STATS, GO_LAST_ON, GO_LAST_OFF, M_ADDMEM, M_DELETE, M_READ, M_REPLY, M_UNREAD, P_AOL, P_DELETE, P_EDIT, P_EMAIL, P_ICQ, P_MSG, P_PROFILE, P_QUOTE, P_WEBSITE, CAT_IMG, B_HOT_DOT, B_NEW_DOT, B_HOT_NN_DOT, B_NORM_DOT, B_POLL_DOT, B_POLL_NN_DOT, NEW_POST) VALUES (1, 'Invision Board Image Set', '<img src=\'style_images/1/t_closed.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/t_moved.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/t_poll.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/t_closed.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/t_new.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/t_reply.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/pip.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_hot.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_hot_no.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_closed.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_moved.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_norm.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_norm_no.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_pinned.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_poll.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_poll_no.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/bf_readonly.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/bf_nonew.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/bc_nonew.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/br_nonew.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/bf_new.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/bc_new.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/br_new.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/user.gif\' border=\'0\'  alt=\'\'>', ' ->', '<img src=\'style_images/1/nav.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/stats.gif\' border=\'0\'  alt=\'\'>', '', '', '<img src=\'style_images/1/msg_l_addmem.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/msg_l_delete.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_norm_no.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/msg_l_reply.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/f_norm.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_aim.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_delete.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_edit.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_email.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_icq.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_pm.gif\' border=\'0\'  alt=\'\'>', '[ Profile ]', '<img src=\'style_images/1/p_quote.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/p_www.gif\' border=\'0\'  alt=\'\'>', '<img src=\'style_images/1/nav_m.gif\' border=\'0\'  alt=\'\' width=\'8\' height=\'8\'>', '<img src=\'style_images/1/f_hot_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/f_norm_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/f_hot_no_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/f_norm_no_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/f_poll_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/f_poll_no_dot.gif\' border=\'0\' alt=\'\'>', '<img src=\'style_images/1/newpost.gif\' border=\'0\'  alt=\'Goto last unread\' title=\'Goto last unread\' hspace=2>')";
  1495. $SQL[] = "INSERT INTO ibf_members (id, name, mgroup, password, email, joined, ip_address, avatar, avatar_size, posts, photo, aim_name, icq_number, location, signature, website, yahoo, title, allow_admin_mails, time_offset, interests, hide_email, email_pm, email_full, skin, warn_level, language, msnname, last_post, allow_post, view_sigs, view_img, view_avs, view_pop, bday_day, bday_month, bday_year, new_msg, msg_from_id, msg_msg_id, msg_total, vdirs, show_popup, validate_key, prev_group, new_pass, misc, last_visit, last_activity) VALUES (0, 'Guest', 2, '', 'guest@ibforums.com', 0, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, 0, 0, 0)";
  1496.  
  1497. $SQL[] = "INSERT INTO ibf_skins (uid, sname, sid, set_id, tmpl_id, img_id, css_id, tbl_width, tbl_border, hidden, default_set) VALUES (1, 'Invision Board', 0, 1, 1, 1, 1, '95%', '#999999', 0, 1)";
  1498.  
  1499. $SQL[] = "INSERT INTO ibf_stats (TOTAL_REPLIES, TOTAL_TOPICS, LAST_MEM_NAME, LAST_MEM_ID, MOST_DATE, MOST_COUNT, MEM_COUNT) VALUES (0, 0, NULL, '0', '0', '0', '0' )";
  1500.  
  1501. $SQL[] = "INSERT INTO ibf_templates (tmid, template, name) VALUES (1, '<html>    <head>      <title>                <% TITLE %>      </title>      <% GENERATOR %>      <% CSS %>      <% JAVASCRIPT %>          </head><body bgcolor=\'#FFFFFF\' leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" alink=\'#000000\' vlink=\'#000000\'><% BOARD HEADER %><% NAVIGATION %><% BOARD %><% STATS %><% COPYRIGHT %></body></html>', 'Invision Board Standard')";
  1502.  
  1503. $SQL[] = "INSERT INTO ibf_titles (id, posts, title, pips) VALUES (1, 0, 'Newbie', '1')";
  1504. $SQL[] = "INSERT INTO ibf_titles (id, posts, title, pips) VALUES (2, 10, 'Member', '2')";
  1505. $SQL[] = "INSERT INTO ibf_titles (id, posts, title, pips) VALUES (4, 30, 'Advanced Member', '3')";
  1506.  
  1507. $SQL[] = "INSERT INTO ibf_tmpl_names (skid, skname, author, email, url) VALUES (1, 'Invision Board Template Set', 'Invision Board', 'skins@invisionboard.com', 'http://www.invisionboard.com')";
  1508.  
  1509. $SQL[] = "INSERT INTO ibf_languages (ldir, lname, lauthor, lemail) VALUES ('en', 'English', 'Invision Board', 'languages@invisionboard.com')";
  1510.  
  1511. return $SQL;
  1512. }
  1513.  
  1514. ?>